{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 90,  32,  77],\n",
       "       [ 83, 111,  23],\n",
       "       [ 24, 117, 115],\n",
       "       [ 68,  10,  69],\n",
       "       [103,  64,  22],\n",
       "       [ 17, 108,  17],\n",
       "       [ 14,  92,  88],\n",
       "       [  4,  63,  24],\n",
       "       [ 22, 101,  19],\n",
       "       [ 40,  39,  91],\n",
       "       [108,  77,  38],\n",
       "       [  7,  98,  10],\n",
       "       [ 44,  82,  79],\n",
       "       [ 77,  79,   8],\n",
       "       [ 77,  84,  15],\n",
       "       [  7,  58,   3],\n",
       "       [105,  10,  41],\n",
       "       [ 53,  93,  79],\n",
       "       [ 88,  24,  57],\n",
       "       [ 65,  61,   9],\n",
       "       [ 56,  15,  54],\n",
       "       [ 37,  17,  72],\n",
       "       [ 48,  45,  23],\n",
       "       [ 24,  79, 108],\n",
       "       [ 97,   0,  51],\n",
       "       [ 22, 110,  37],\n",
       "       [ 29,  32,   0],\n",
       "       [ 27, 115,  71],\n",
       "       [ 39,  52, 119],\n",
       "       [ 25,  43, 110],\n",
       "       [ 37,  73, 111],\n",
       "       [ 57,  88,  24],\n",
       "       [ 82,   1, 105],\n",
       "       [ 34,  69,  61],\n",
       "       [ 78,  85,  30],\n",
       "       [ 95,  60,  11],\n",
       "       [ 94,  11,  26],\n",
       "       [ 93,  23,  68],\n",
       "       [ 14,  11,  51],\n",
       "       [ 30, 110, 100],\n",
       "       [ 91,  69, 107],\n",
       "       [ 20,  75, 109],\n",
       "       [  5,  63, 110],\n",
       "       [ 73,  95,  82],\n",
       "       [ 37,  67,  21],\n",
       "       [ 72,  15,  84],\n",
       "       [114,  36,  50],\n",
       "       [ 92,  94,  55],\n",
       "       [ 90,  93,  89],\n",
       "       [107,  27, 115]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 22,  92,  66],\n",
       "       [104,  91, 103],\n",
       "       [ 57,  50,  34],\n",
       "       [  1, 116,  59],\n",
       "       [ 66,  73,  24],\n",
       "       [ 51,  88,  69],\n",
       "       [108,  99, 110],\n",
       "       [ 30,  40,  26],\n",
       "       [ 39, 106,  92],\n",
       "       [  5,  20,  40],\n",
       "       [ 11,  37, 115],\n",
       "       [ 83, 117,  12],\n",
       "       [ 43,  87,  96],\n",
       "       [ 64,  85,  71],\n",
       "       [ 34,   0,  51],\n",
       "       [ 50,  11,  48],\n",
       "       [ 33,  59,  69],\n",
       "       [ 30,  60,  86],\n",
       "       [ 97,  14,  19],\n",
       "       [ 87,  88,  99],\n",
       "       [102,   3,  90],\n",
       "       [ 74,  93,  73],\n",
       "       [ 18,  99,  83],\n",
       "       [ 77, 106,  20],\n",
       "       [ 15,  26,  29],\n",
       "       [ 96, 116, 117],\n",
       "       [ 95, 109,  53],\n",
       "       [109, 106,  11],\n",
       "       [104,  53,  58],\n",
       "       [ 97,  28,  14],\n",
       "       [ 19, 104,  11],\n",
       "       [ 52,  89,  34],\n",
       "       [ 39,  10,  21],\n",
       "       [ 79,  75,  27],\n",
       "       [112, 115,  75],\n",
       "       [ 20,  48,  16],\n",
       "       [115,  82, 120],\n",
       "       [112,  58, 113],\n",
       "       [ 34,  41,  39],\n",
       "       [ 92, 109, 117],\n",
       "       [ 21,  28,  11],\n",
       "       [100,  37, 104],\n",
       "       [  9,  53,  46],\n",
       "       [ 92,  83,  49],\n",
       "       [ 89,  56,  98],\n",
       "       [ 95,  67,  58],\n",
       "       [ 13,   0,  71],\n",
       "       [ 99, 107,  86],\n",
       "       [  1, 106,  91],\n",
       "       [ 13,  89, 119]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 80, 113,  12],\n",
       "       [112, 119,  55],\n",
       "       [ 77, 110,  65],\n",
       "       [107,  38, 120],\n",
       "       [ 64,  94,  19],\n",
       "       [105,  44,  76],\n",
       "       [ 58,  81, 116],\n",
       "       [ 10, 104, 102],\n",
       "       [  7, 111,  22],\n",
       "       [ 47,  44,  75],\n",
       "       [106,  31,  36],\n",
       "       [ 97,  31,  77],\n",
       "       [  8,  82,  54],\n",
       "       [ 32,  79,  92],\n",
       "       [  8,  40,  60],\n",
       "       [ 58,  92,  71],\n",
       "       [ 53,  54, 112],\n",
       "       [  8,  64,  91],\n",
       "       [113,   7,   6],\n",
       "       [ 61,  52, 107],\n",
       "       [ 13,  99,  72],\n",
       "       [ 52,  87,   0],\n",
       "       [  4,  32,  62],\n",
       "       [ 48,  36,  61],\n",
       "       [ 38,  60,  59],\n",
       "       [ 40, 114,  80],\n",
       "       [ 45,  16,  59],\n",
       "       [101,  25, 117],\n",
       "       [ 87,  81,  25],\n",
       "       [ 76,  27,   9],\n",
       "       [ 95,  29,  61],\n",
       "       [ 75, 109,   4],\n",
       "       [ 25,  25, 115],\n",
       "       [100, 108,  26],\n",
       "       [101,  21,  95],\n",
       "       [ 54,  41,  86],\n",
       "       [ 51,   7, 109],\n",
       "       [ 85,  93,  35],\n",
       "       [ 77,  91, 106],\n",
       "       [ 94,  14,   2],\n",
       "       [ 94, 116,  38],\n",
       "       [ 35,  98,  88],\n",
       "       [ 52, 105,  30],\n",
       "       [ 67,  56, 108],\n",
       "       [ 14,  49,  65],\n",
       "       [ 63,  24, 113],\n",
       "       [109,  13,  46],\n",
       "       [ 93,  11, 114],\n",
       "       [ 33, 101,  14],\n",
       "       [119,  44, 115]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 26,  20, 101],\n",
       "       [ 91, 111,  26],\n",
       "       [ 41,  71,  36],\n",
       "       [102,  53,  84],\n",
       "       [  9,   4,  38],\n",
       "       [120, 109,  45],\n",
       "       [ 52, 112,  63],\n",
       "       [ 55,  56,  94],\n",
       "       [ 30,  81,  87],\n",
       "       [ 89,  37,  55],\n",
       "       [ 74, 117,  55],\n",
       "       [ 92,  71,  61],\n",
       "       [108,  25,  14],\n",
       "       [ 87,  90,  48],\n",
       "       [ 76,  53,  62],\n",
       "       [ 29,   8,  20],\n",
       "       [ 63,  26,  46],\n",
       "       [  9, 116,  53],\n",
       "       [ 87,  45, 117],\n",
       "       [ 56,   9,  34],\n",
       "       [116,  44,  94],\n",
       "       [118, 116,   2],\n",
       "       [111,   3,  40],\n",
       "       [ 63,  67,  40],\n",
       "       [ 32, 118, 117],\n",
       "       [101,  70,  53],\n",
       "       [113,  29,  64],\n",
       "       [112, 116,  74],\n",
       "       [ 95,  44, 113],\n",
       "       [117,  73,  74],\n",
       "       [ 93,   4,   3],\n",
       "       [ 63,  75,  76],\n",
       "       [108, 110,  51],\n",
       "       [ 61,  26,  85],\n",
       "       [ 98,  25,  64],\n",
       "       [ 45, 120, 114],\n",
       "       [ 57,  31,  68],\n",
       "       [ 95,  11,  21],\n",
       "       [ 66,  24,  97],\n",
       "       [ 89,  33, 112],\n",
       "       [118,  45,   8],\n",
       "       [ 32, 108,  41],\n",
       "       [  5,  31,  89],\n",
       "       [105, 120,  55],\n",
       "       [ 19, 108,  87],\n",
       "       [  7,  17,  28],\n",
       "       [ 92,  40,  58],\n",
       "       [ 62,  79,  87],\n",
       "       [ 14,  89,  86],\n",
       "       [  5,  21,  13]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 90,   5, 119],\n",
       "       [ 18,   1,  19],\n",
       "       [ 39,  30, 119],\n",
       "       [ 44, 104,  94],\n",
       "       [ 58,  92,  84],\n",
       "       [ 17,  64,  23],\n",
       "       [ 82, 101,  44],\n",
       "       [ 97,  79, 114],\n",
       "       [ 20,   2,  40],\n",
       "       [ 11,  12, 117],\n",
       "       [103,  55, 108],\n",
       "       [ 99,  36,  96],\n",
       "       [ 64,  30,  35],\n",
       "       [  8,  27,  78],\n",
       "       [107,  92,  91],\n",
       "       [115,  83,  17],\n",
       "       [100,  98,   5],\n",
       "       [ 18,  77, 100],\n",
       "       [ 36,  95,   7],\n",
       "       [ 54,  53,  23],\n",
       "       [ 71,  88,  35],\n",
       "       [ 67,  99,  49],\n",
       "       [101, 114,  95],\n",
       "       [ 45, 102,  64],\n",
       "       [ 80,   7,  41],\n",
       "       [ 37,  41,  57],\n",
       "       [ 23,  23,  70],\n",
       "       [ 57,  92,  96],\n",
       "       [ 65,  84, 115],\n",
       "       [ 57,   9, 113],\n",
       "       [ 97,  71,  60],\n",
       "       [ 69,  67, 116],\n",
       "       [ 45,  65,  94],\n",
       "       [ 71,  13,  73],\n",
       "       [107, 104,  47],\n",
       "       [ 60,  64,  89],\n",
       "       [ 59,  52,  19],\n",
       "       [ 63,  10, 108],\n",
       "       [  2,  20,  81],\n",
       "       [ 51, 101,  60],\n",
       "       [  3,  29,  61],\n",
       "       [116,  98,  94],\n",
       "       [ 18,  32,  61],\n",
       "       [ 24, 106,  45],\n",
       "       [ 95,   4,   6],\n",
       "       [119,  69,  98],\n",
       "       [ 61,  49, 111],\n",
       "       [ 53,  63, 108],\n",
       "       [ 80,  22,  90],\n",
       "       [ 80,  58, 101]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 20,  57, 119],\n",
       "       [ 17,  22,  33],\n",
       "       [  3,  55,   0],\n",
       "       [ 67,  93,  93],\n",
       "       [ 22,  58,  94],\n",
       "       [ 53,  99,  58],\n",
       "       [ 51,  29, 108],\n",
       "       [ 99,  60,  53],\n",
       "       [ 34,  41,  86],\n",
       "       [ 28,  53,  70],\n",
       "       [  2, 107, 112],\n",
       "       [  1,  25,  77],\n",
       "       [ 81,  62,   9],\n",
       "       [  6,  57,   7],\n",
       "       [  1,  36,  22],\n",
       "       [109,  15,  15],\n",
       "       [ 44,  88,  11],\n",
       "       [ 32,  32,  33],\n",
       "       [ 62, 107, 116],\n",
       "       [  2,  69,  49],\n",
       "       [108,  74, 102],\n",
       "       [112,  16, 111],\n",
       "       [ 92,  19,  78],\n",
       "       [ 85,  82,  77],\n",
       "       [ 64, 102,  87],\n",
       "       [ 79,  26,  55],\n",
       "       [ 55,  75,  27],\n",
       "       [ 95, 102,  73],\n",
       "       [ 41,  44,  49],\n",
       "       [ 52, 101,  94],\n",
       "       [ 24,  86,  71],\n",
       "       [115,  23,  92],\n",
       "       [ 27,  81,  33],\n",
       "       [ 48,  52,  96],\n",
       "       [118, 115, 110],\n",
       "       [ 92,  66,  19],\n",
       "       [ 41,  21,  57],\n",
       "       [ 19, 118,  44],\n",
       "       [ 42,  97, 101],\n",
       "       [110,   8,  55],\n",
       "       [ 69, 120,  26],\n",
       "       [  6,  58,  43],\n",
       "       [ 66,  16,  85],\n",
       "       [  9, 104,  63],\n",
       "       [ 90,  42,  29],\n",
       "       [ 77,  52,  60],\n",
       "       [ 21,  97, 115],\n",
       "       [ 77,  81,  65],\n",
       "       [ 74,  87,   1],\n",
       "       [ 72,  26,   7]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 1.随机数生成六个班的考试成绩，3门考试：Python、数学、语文。每个班50人\n",
    "class1 = np.random.randint(0,121,size =(50,3))\n",
    "class2 = np.random.randint(0,121,size =(50,3))\n",
    "class3 = np.random.randint(0,121,size =(50,3))\n",
    "class4 = np.random.randint(0,121,size =(50,3))\n",
    "class5 = np.random.randint(0,121,size =(50,3))\n",
    "class6 = np.random.randint(0,121,size =(50,3))\n",
    "display(class1,class2,class3,class4,class5,class6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 90,  32,  77],\n",
       "       [ 83, 111,  23],\n",
       "       [ 24, 117, 115],\n",
       "       [ 68,  10,  69],\n",
       "       [103,  64,  22],\n",
       "       [ 17, 108,  17],\n",
       "       [ 14,  92,  88],\n",
       "       [  4,  63,  24],\n",
       "       [ 22, 101,  19],\n",
       "       [ 40,  39,  91],\n",
       "       [108,  77,  38],\n",
       "       [  7,  98,  10],\n",
       "       [ 44,  82,  79],\n",
       "       [ 77,  79,   8],\n",
       "       [ 77,  84,  15],\n",
       "       [  7,  58,   3],\n",
       "       [105,  10,  41],\n",
       "       [ 53,  93,  79],\n",
       "       [ 88,  24,  57],\n",
       "       [ 65,  61,   9],\n",
       "       [ 56,  15,  54],\n",
       "       [ 37,  17,  72],\n",
       "       [ 48,  45,  23],\n",
       "       [ 24,  79, 108],\n",
       "       [ 97,   0,  51],\n",
       "       [ 22, 110,  37],\n",
       "       [ 29,  32,   0],\n",
       "       [ 27, 115,  71],\n",
       "       [ 39,  52, 119],\n",
       "       [ 25,  43, 110],\n",
       "       [ 37,  73, 111],\n",
       "       [ 57,  88,  24],\n",
       "       [ 82,   1, 105],\n",
       "       [ 34,  69,  61],\n",
       "       [ 78,  85,  30],\n",
       "       [ 95,  60,  11],\n",
       "       [ 94,  11,  26],\n",
       "       [ 93,  23,  68],\n",
       "       [ 14,  11,  51],\n",
       "       [ 30, 110, 100],\n",
       "       [ 91,  69, 107],\n",
       "       [ 20,  75, 109],\n",
       "       [  5,  63, 110],\n",
       "       [ 73,  95,  82],\n",
       "       [ 37,  67,  21],\n",
       "       [ 72,  15,  84],\n",
       "       [114,  36,  50],\n",
       "       [ 92,  94,  55],\n",
       "       [ 90,  93,  89],\n",
       "       [107,  27, 115],\n",
       "       [ 22,  92,  66],\n",
       "       [104,  91, 103],\n",
       "       [ 57,  50,  34],\n",
       "       [  1, 116,  59],\n",
       "       [ 66,  73,  24],\n",
       "       [ 51,  88,  69],\n",
       "       [108,  99, 110],\n",
       "       [ 30,  40,  26],\n",
       "       [ 39, 106,  92],\n",
       "       [  5,  20,  40],\n",
       "       [ 11,  37, 115],\n",
       "       [ 83, 117,  12],\n",
       "       [ 43,  87,  96],\n",
       "       [ 64,  85,  71],\n",
       "       [ 34,   0,  51],\n",
       "       [ 50,  11,  48],\n",
       "       [ 33,  59,  69],\n",
       "       [ 30,  60,  86],\n",
       "       [ 97,  14,  19],\n",
       "       [ 87,  88,  99],\n",
       "       [102,   3,  90],\n",
       "       [ 74,  93,  73],\n",
       "       [ 18,  99,  83],\n",
       "       [ 77, 106,  20],\n",
       "       [ 15,  26,  29],\n",
       "       [ 96, 116, 117],\n",
       "       [ 95, 109,  53],\n",
       "       [109, 106,  11],\n",
       "       [104,  53,  58],\n",
       "       [ 97,  28,  14],\n",
       "       [ 19, 104,  11],\n",
       "       [ 52,  89,  34],\n",
       "       [ 39,  10,  21],\n",
       "       [ 79,  75,  27],\n",
       "       [112, 115,  75],\n",
       "       [ 20,  48,  16],\n",
       "       [115,  82, 120],\n",
       "       [112,  58, 113],\n",
       "       [ 34,  41,  39],\n",
       "       [ 92, 109, 117],\n",
       "       [ 21,  28,  11],\n",
       "       [100,  37, 104],\n",
       "       [  9,  53,  46],\n",
       "       [ 92,  83,  49],\n",
       "       [ 89,  56,  98],\n",
       "       [ 95,  67,  58],\n",
       "       [ 13,   0,  71],\n",
       "       [ 99, 107,  86],\n",
       "       [  1, 106,  91],\n",
       "       [ 13,  89, 119],\n",
       "       [ 80, 113,  12],\n",
       "       [112, 119,  55],\n",
       "       [ 77, 110,  65],\n",
       "       [107,  38, 120],\n",
       "       [ 64,  94,  19],\n",
       "       [105,  44,  76],\n",
       "       [ 58,  81, 116],\n",
       "       [ 10, 104, 102],\n",
       "       [  7, 111,  22],\n",
       "       [ 47,  44,  75],\n",
       "       [106,  31,  36],\n",
       "       [ 97,  31,  77],\n",
       "       [  8,  82,  54],\n",
       "       [ 32,  79,  92],\n",
       "       [  8,  40,  60],\n",
       "       [ 58,  92,  71],\n",
       "       [ 53,  54, 112],\n",
       "       [  8,  64,  91],\n",
       "       [113,   7,   6],\n",
       "       [ 61,  52, 107],\n",
       "       [ 13,  99,  72],\n",
       "       [ 52,  87,   0],\n",
       "       [  4,  32,  62],\n",
       "       [ 48,  36,  61],\n",
       "       [ 38,  60,  59],\n",
       "       [ 40, 114,  80],\n",
       "       [ 45,  16,  59],\n",
       "       [101,  25, 117],\n",
       "       [ 87,  81,  25],\n",
       "       [ 76,  27,   9],\n",
       "       [ 95,  29,  61],\n",
       "       [ 75, 109,   4],\n",
       "       [ 25,  25, 115],\n",
       "       [100, 108,  26],\n",
       "       [101,  21,  95],\n",
       "       [ 54,  41,  86],\n",
       "       [ 51,   7, 109],\n",
       "       [ 85,  93,  35],\n",
       "       [ 77,  91, 106],\n",
       "       [ 94,  14,   2],\n",
       "       [ 94, 116,  38],\n",
       "       [ 35,  98,  88],\n",
       "       [ 52, 105,  30],\n",
       "       [ 67,  56, 108],\n",
       "       [ 14,  49,  65],\n",
       "       [ 63,  24, 113],\n",
       "       [109,  13,  46],\n",
       "       [ 93,  11, 114],\n",
       "       [ 33, 101,  14],\n",
       "       [119,  44, 115],\n",
       "       [ 26,  20, 101],\n",
       "       [ 91, 111,  26],\n",
       "       [ 41,  71,  36],\n",
       "       [102,  53,  84],\n",
       "       [  9,   4,  38],\n",
       "       [120, 109,  45],\n",
       "       [ 52, 112,  63],\n",
       "       [ 55,  56,  94],\n",
       "       [ 30,  81,  87],\n",
       "       [ 89,  37,  55],\n",
       "       [ 74, 117,  55],\n",
       "       [ 92,  71,  61],\n",
       "       [108,  25,  14],\n",
       "       [ 87,  90,  48],\n",
       "       [ 76,  53,  62],\n",
       "       [ 29,   8,  20],\n",
       "       [ 63,  26,  46],\n",
       "       [  9, 116,  53],\n",
       "       [ 87,  45, 117],\n",
       "       [ 56,   9,  34],\n",
       "       [116,  44,  94],\n",
       "       [118, 116,   2],\n",
       "       [111,   3,  40],\n",
       "       [ 63,  67,  40],\n",
       "       [ 32, 118, 117],\n",
       "       [101,  70,  53],\n",
       "       [113,  29,  64],\n",
       "       [112, 116,  74],\n",
       "       [ 95,  44, 113],\n",
       "       [117,  73,  74],\n",
       "       [ 93,   4,   3],\n",
       "       [ 63,  75,  76],\n",
       "       [108, 110,  51],\n",
       "       [ 61,  26,  85],\n",
       "       [ 98,  25,  64],\n",
       "       [ 45, 120, 114],\n",
       "       [ 57,  31,  68],\n",
       "       [ 95,  11,  21],\n",
       "       [ 66,  24,  97],\n",
       "       [ 89,  33, 112],\n",
       "       [118,  45,   8],\n",
       "       [ 32, 108,  41],\n",
       "       [  5,  31,  89],\n",
       "       [105, 120,  55],\n",
       "       [ 19, 108,  87],\n",
       "       [  7,  17,  28],\n",
       "       [ 92,  40,  58],\n",
       "       [ 62,  79,  87],\n",
       "       [ 14,  89,  86],\n",
       "       [  5,  21,  13],\n",
       "       [ 90,   5, 119],\n",
       "       [ 18,   1,  19],\n",
       "       [ 39,  30, 119],\n",
       "       [ 44, 104,  94],\n",
       "       [ 58,  92,  84],\n",
       "       [ 17,  64,  23],\n",
       "       [ 82, 101,  44],\n",
       "       [ 97,  79, 114],\n",
       "       [ 20,   2,  40],\n",
       "       [ 11,  12, 117],\n",
       "       [103,  55, 108],\n",
       "       [ 99,  36,  96],\n",
       "       [ 64,  30,  35],\n",
       "       [  8,  27,  78],\n",
       "       [107,  92,  91],\n",
       "       [115,  83,  17],\n",
       "       [100,  98,   5],\n",
       "       [ 18,  77, 100],\n",
       "       [ 36,  95,   7],\n",
       "       [ 54,  53,  23],\n",
       "       [ 71,  88,  35],\n",
       "       [ 67,  99,  49],\n",
       "       [101, 114,  95],\n",
       "       [ 45, 102,  64],\n",
       "       [ 80,   7,  41],\n",
       "       [ 37,  41,  57],\n",
       "       [ 23,  23,  70],\n",
       "       [ 57,  92,  96],\n",
       "       [ 65,  84, 115],\n",
       "       [ 57,   9, 113],\n",
       "       [ 97,  71,  60],\n",
       "       [ 69,  67, 116],\n",
       "       [ 45,  65,  94],\n",
       "       [ 71,  13,  73],\n",
       "       [107, 104,  47],\n",
       "       [ 60,  64,  89],\n",
       "       [ 59,  52,  19],\n",
       "       [ 63,  10, 108],\n",
       "       [  2,  20,  81],\n",
       "       [ 51, 101,  60],\n",
       "       [  3,  29,  61],\n",
       "       [116,  98,  94],\n",
       "       [ 18,  32,  61],\n",
       "       [ 24, 106,  45],\n",
       "       [ 95,   4,   6],\n",
       "       [119,  69,  98],\n",
       "       [ 61,  49, 111],\n",
       "       [ 53,  63, 108],\n",
       "       [ 80,  22,  90],\n",
       "       [ 80,  58, 101],\n",
       "       [ 20,  57, 119],\n",
       "       [ 17,  22,  33],\n",
       "       [  3,  55,   0],\n",
       "       [ 67,  93,  93],\n",
       "       [ 22,  58,  94],\n",
       "       [ 53,  99,  58],\n",
       "       [ 51,  29, 108],\n",
       "       [ 99,  60,  53],\n",
       "       [ 34,  41,  86],\n",
       "       [ 28,  53,  70],\n",
       "       [  2, 107, 112],\n",
       "       [  1,  25,  77],\n",
       "       [ 81,  62,   9],\n",
       "       [  6,  57,   7],\n",
       "       [  1,  36,  22],\n",
       "       [109,  15,  15],\n",
       "       [ 44,  88,  11],\n",
       "       [ 32,  32,  33],\n",
       "       [ 62, 107, 116],\n",
       "       [  2,  69,  49],\n",
       "       [108,  74, 102],\n",
       "       [112,  16, 111],\n",
       "       [ 92,  19,  78],\n",
       "       [ 85,  82,  77],\n",
       "       [ 64, 102,  87],\n",
       "       [ 79,  26,  55],\n",
       "       [ 55,  75,  27],\n",
       "       [ 95, 102,  73],\n",
       "       [ 41,  44,  49],\n",
       "       [ 52, 101,  94],\n",
       "       [ 24,  86,  71],\n",
       "       [115,  23,  92],\n",
       "       [ 27,  81,  33],\n",
       "       [ 48,  52,  96],\n",
       "       [118, 115, 110],\n",
       "       [ 92,  66,  19],\n",
       "       [ 41,  21,  57],\n",
       "       [ 19, 118,  44],\n",
       "       [ 42,  97, 101],\n",
       "       [110,   8,  55],\n",
       "       [ 69, 120,  26],\n",
       "       [  6,  58,  43],\n",
       "       [ 66,  16,  85],\n",
       "       [  9, 104,  63],\n",
       "       [ 90,  42,  29],\n",
       "       [ 77,  52,  60],\n",
       "       [ 21,  97, 115],\n",
       "       [ 77,  81,  65],\n",
       "       [ 74,  87,   1],\n",
       "       [ 72,  26,   7]])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 2.将六个班的考试成绩进行合并得到score\n",
    "score = np.concatenate([class1,class2,class3,class4,class5,class6])\n",
    "score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  1,  90,  32,  77],\n",
       "       [  0,  83, 111,  23],\n",
       "       [  1,  24, 117, 115],\n",
       "       ...,\n",
       "       [  0,  77,  81,  65],\n",
       "       [  0,  74,  87,   1],\n",
       "       [  1,  72,  26,   7]])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 3.生成性别数组sex，水平叠加数组sex和score得到data\n",
    "sex = np.random.randint(0,2,size = (300,1))\n",
    "data = np.hstack((sex,score))\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 4.分别计算男女生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差\n",
    "f = data[:,0] == 1 # 女生组\n",
    "m = data[:,0] == 0 # 男生组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 0, 0])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([  0, 119, 117, 120])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([ 0.  , 61.25, 64.69, 62.73])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([ 0. , 64.5, 67. , 63. ])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([ 0.  , 35.03, 34.63, 33.73])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 女生组各科成绩最小值、最大值、平均分、中位数、标准差\n",
    "score_min_f = data[f].min(axis = 0) # 最小值\n",
    "score_max_f = data[f].max(axis = 0) # 最大值\n",
    "score_mean_f = data[f].mean(axis = 0).round(2) # 平均分\n",
    "score_median_f = np.median(data[f],axis = 0) # 中位数\n",
    "score_std_f = data[f].std(axis = 0).round(2) # 标准差\n",
    "display(score_min_f,score_max_f,score_mean_f,score_median_f,score_std_f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 1, 0, 0])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([  1, 120, 120, 120])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([ 1.  , 60.43, 59.88, 64.57])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([ 1., 57., 56., 63.])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([ 0.  , 35.08, 36.09, 36.6 ])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 男生组各科成绩最小值、最大值、平均分、中位数、标准差\n",
    "score_min_m = data[m].min(axis = 0) # 最小值\n",
    "score_max_m = data[m].max(axis = 0) # 最大值\n",
    "score_mean_m = data[m].mean(axis = 0).round(2) # 平均分\n",
    "score_median_m = np.median(data[m],axis = 0) # 中位数\n",
    "score_std_m = data[m].std(axis = 0).round(2) # 标准差\n",
    "display(score_min_m,score_max_m,score_mean_m,score_median_m,score_std_m)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
